﻿using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using MRSite.Common.Configuration;
using MRSite.Common.Dependency;
using MRSite.Common.Kernels;
using MRSite.Common.Reflection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MRSite.Common
{
    public class CommonInstaller : IWindsorInstaller
    {
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(
                Component.For<IKernelManager>().ImplementedBy<KernelManager>().LifestyleSingleton(),
                Component.For<IAssemblyFinder>().ImplementedBy<AssemblyFinder>().LifestyleSingleton(),
                Component.For<ITypeFinder, TypeFinder>().ImplementedBy<TypeFinder>().LifestyleSingleton(),
                Component.For<IBasicRegister>().ImplementedBy<BasicRegister>().LifestyleTransient(),
                Component.For<IConfigurationManager, ConfigurationManager>().ImplementedBy<ConfigurationManager>().LifestyleSingleton()
                );
        }
    }
}
